#!/bin/bash
source /etc/profile

mkdir -p /home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`
echo "------------------------------------------------------------------------"
start=`date +%s`
echo "开始数据抽取，start dailysqoop"`date +"%Y-%m-%d %H:%M"`
sh /home/marvin/daily_job/sqoop/dailysqoop.sh >>/home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`/dailysqoop.loglog 2>&1
dailysqoop_end=`date +%s`
usetime=`expr $dailysqoop_end - $start`
echo "数据抽取结束，end dailysqoop,usetime:$usetime"


echo "------------------------------------------------------------------------"
start=`date +%s`
echo "开始执行hql，start dailyhql"`date +"%Y-%m-%d %H:%M"`
sh /home/marvin/dailynoon_job/hive/dailynoonhql.sh >>/home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`/dailynoonhql.loglog 2>&1
end=`date +%s`
usetime=`expr $end - $start`
echo "hql结束，end dailyhql,usetime:$usetime"

echo "------------------------------------------------------------------------"
start=`date +%s`
echo "开始执行向mysql导数据，start hive to mysql"`date +"%Y-%m-%d %H:%M"`
sh /home/marvin/dailynoon_job/delete_or_truncate/dailynoontruncate.sh >>/home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`/dailytruncate.loglog 2>&1
sh /home/marvin/dailynoon_job/sqoop/dailynoonhqlsqoop.sh >>/home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`/dailynoonhqlsqoop.loglog 2>&1
sh /home/marvin/daily_job/delete_or_truncate/dailydelete.sh >>/home/marvin/dailynoon_job/logs/`date +%Y-%m-%d`/dailydelete.loglog 2>&1
end=`date +%s`
usetime=`expr $end - $start`
echo "hive to mysql结束,end,usetime:$usetime"
